]> dgit.raspbian.org Git - ostree.git/commitdiff
ci/prow: Use RPMs with dnf instead of raw file overlay
authorJoseph Marrero Corchado <jmarrero@redhat.com>
Wed, 24 Jun 2026 15:20:21 +0000 (11:20 -0400)
committerJoseph Marrero Corchado <jmarrero@redhat.com>
Wed, 24 Jun 2026 17:18:01 +0000 (13:18 -0400)
The builder and coreos-assembler images may ship different library
versions (e.g. gpgme), causing soname mismatches at runtime. Use RPM
overrides for cosa and dnf for the container itself.

ci/prow/Dockerfile
ci/prow/fcos-e2e.sh

index 40494256386bd2eec0acf1b409c97912654bc74d..4df04466bb0a7e626dc4f2745b8ce552b6f5a8f5 100644 (file)
@@ -2,20 +2,42 @@ FROM quay.io/coreos-assembler/fcos-buildroot:testing-devel as builder
 WORKDIR /src
 COPY . .
 RUN ./ci/build.sh
-RUN make -C target/c install DESTDIR=/cosa/component-install
 RUN make -C tests/kolainst
 RUN make -C tests/kolainst install DESTDIR=/cosa/component-tests
-# Uncomment this to fake a build to test the code below
-#RUN mkdir -p /cosa/component-install/usr/bin && echo foo > /cosa/component-install/usr/bin/foo
+
+# Build RPMs inside the cosa base image so they link against its libraries.
+# The buildroot (Fedora N+1) and cosa (Fedora N) may ship different sonames.
+FROM quay.io/coreos-assembler/coreos-assembler:latest as rpmbuild
+USER root
+COPY --from=builder /src /src
+WORKDIR /src
+RUN dnf -y install /usr/bin/rpmbuild gcc
+RUN <<EORUN
+set -xeuo pipefail
+git config --global --add safe.directory '*'
+git submodule update --init
+ci/make-git-snapshot.sh
+ci/packit-fix-spec.sh ostree.spec
+rpmbuild -bs --define "_sourcedir ${PWD}" --define "_specdir ${PWD}" \
+    --define "_builddir ${PWD}" --define "_srcrpmdir ${PWD}" \
+    --define "_rpmdir ${PWD}" --define "_buildrootdir ${PWD}/.build" ostree.spec
+dnf builddep -y *.src.rpm
+ci/rpmbuild-cwd --rebuild *.src.rpm
+mkdir -p /rpms
+find . -name '*.rpm' -not -name '*.src.rpm' -exec mv {} /rpms/ \;
+EORUN
 
 FROM quay.io/coreos-assembler/coreos-assembler:latest
 WORKDIR /srv
 USER root
-# Copy binaries from the build
-COPY --from=builder /cosa /cosa
-# Merge them to the real root since we're used at compose time
-RUN rsync -rlv /cosa/component-install/ /
-# Merge installed tests
+# Install RPMs built against this image's libraries
+COPY --from=rpmbuild /rpms/*.rpm /tmp/rpms/
+RUN dnf -y install --allowerasing $(ls /tmp/rpms/ostree-*.rpm | grep -v -e devel -e debug) && \
+    rm -rf /tmp/rpms
+# Stage RPMs for cosa overrides (used by fcos-e2e.sh)
+COPY --from=rpmbuild /rpms /cosa/rpms
+# Copy test binaries that aren't packaged as RPMs
+COPY --from=builder /cosa/component-tests /cosa/component-tests
 RUN rsync -rlv /cosa/component-tests/ /
 # Grab all of our ci scripts
 COPY --from=builder /src/ci/ /ci/
index f076f31eea74a8d672a668812d6939cac43ae580..9f222b129d2342ede66b191bf684ad9cf8667dfe 100755 (executable)
@@ -3,12 +3,13 @@ set -xeuo pipefail
 
 # Prow jobs don't support adding emptydir today
 export COSA_SKIP_OVERLAY=1
-# And suppress depcheck since we didn't install via RPM
-export COSA_SUPPRESS_DEPCHECK=1
 ostree --version
 cd $(mktemp -d)
 cosa init https://github.com/coreos/fedora-coreos-config/
-rsync -rlv /cosa/component-install/ overrides/rootfs/
+# Use RPM overrides so cosa/rpm-ostree resolves dependencies properly
+cp /cosa/rpms/ostree-*.rpm overrides/rpm/
+# Remove -devel and -debug RPMs that aren't needed in the compose
+rm -f overrides/rpm/ostree-devel-* overrides/rpm/ostree-debug*
 cosa fetch
 # For composefs
 echo 'rootfs: "ext4verity"' >> src/config/image.yaml